package govenor.replicator;

import govenor.manager.GovenorManager;
import govenor.overwatch.OverWatcher;
import govenor.status.StatusHandler;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class ReplicationService {
	public static final int REPLICATION_CHECK_PERIOD = 20;
	public static final int NUMBER_OF_STATUS_THREADS = 1;
	private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(NUMBER_OF_STATUS_THREADS);
	
	public ReplicationService(GovenorManager manager){
		scheduler.scheduleAtFixedRate(new ReplicationHandler(manager), 10, REPLICATION_CHECK_PERIOD, TimeUnit.SECONDS);
	
	}
}
